//package com.police.activity;
//
//import android.app.Activity;
//import android.content.Intent;
//import android.os.Bundle;
//import android.view.Window;
//import com.astrob.mapapi.core.GeoPoint;
//import com.astrob.mapapi.core.PoiItem;
//import com.astrob.mapapi.map.MapView;
//import com.astrob.mapapi.map.PickPoiOverlay;
//import com.astrob.mapapi.map.RouteOverlay;
//import com.astrob.mapapi.map.SelectedPointListener;
//import com.astrob.mapapi.route.Route;
//import com.police.PoliceApp;
//import com.police.R;
//
//import java.util.List;
//
//public class ShowOnMapActivity extends Activity implements SelectedPointListener{
//	private MapView mapView;
//	private PickPoiOverlay pickPoiOverlay;
//	private GeoPoint center;
//
//	@Override
//	public void onCreate(Bundle savedInstanceState) {
//		super.onCreate(savedInstanceState);
//		requestWindowFeature(Window.FEATURE_NO_TITLE);
//		setContentView(R.layout.main);
//		mapView = (MapView) this.findViewById(R.id.main_mapview_id);
//		center = getIntent().getParcelableExtra("center");
//		int zoom = 15;
//
//		mapView.setMapCenter(center);
//		mapView.setZoomLevel(zoom);
//
//		int showType =  ((PoliceApp) getApplication()).getShowType();
//		if (showType == PoliceApp.SHOW_POI){
//			showPOI();
//		}else if (showType == PoliceApp.SHOW_ROUTE){
//			showRoute();
//		}else if (showType == PoliceApp.PICK_POI){
//			pickPOI();
//		}
//	}
//	
//	private void showPOI(){
//		List<PoiItem> poiList = ((PoliceApp) getApplication()).getShowPoiList();
//
////		PoiOverlay poiOverlay = new PoiOverlay(
////				BitmapUtil.getDrawableFromAssets(this, "markericon.png"),
////				poiList, "");
//		//PoiOverlay poiOverlay = new PoiOverlay(this, mapView);
//		MyPoiOverlay poiOverlay = new MyPoiOverlay(this, mapView);
//		poiOverlay.setData(poiList);
//		poiOverlay.addToMap(mapView);
//		poiOverlay.onTap(center, mapView);
//		
//	}
//	
//	private void showRoute(){
//		Route route = ((PoliceApp) getApplication()).getRoute();
//		RouteOverlay routeOverlay = new RouteOverlay(this, mapView);
//		routeOverlay.setData(route);
//		mapView.addLayer(routeOverlay);
//		//mapView.getController().zoomToSpan(route.getOrigin().getLocation(), route.getDest().getLocation());
//	}
//	
//	private void pickPOI(){
//		pickPoiOverlay = new PickPoiOverlay(this, mapView);
//		pickPoiOverlay.addToMap(mapView);
//		pickPoiOverlay.setSelectedPointListener(this);
//	}
//
//	@Override
//	protected void onDestroy() {
//		// TODO Auto-generated method stub
//		super.onDestroy();
//	}
//
//	@Override
//	public void onSelectedPoint(GeoPoint geoPoint) {
//		// TODO Auto-generated method stub
//		pickPoiOverlay.removeFromMap();
//		Intent data = new Intent();
//		data.putExtra("SelectedGeoPoint", geoPoint);
//		setResult(2002, data);
//		this.finish();
//	}
//}